import request from '@/utils/request'

const prePath = "/asset/setting";


//获取设备档案的分页
export function getEquipmentArchivesCustomizePage(data) {
  return request({
    url : prePath + '/assetDict/customizeList/page',
    method : 'post',
    data
  })
}

//根据{id}获取一条设备档案数据
export function detailEquipmentArchives(id) {
  return request({
    url : prePath + '/assetDict/' + id,
    method : 'get'
  })
}
export function delMeasuringInstrument(data) {
  return request({
    url: prePath + '/measuringInstrument',
    method: 'DELETE',
    data
  })
}
//获取设备档案分组
export function getEquipmentArchivesDetailCustomizeGroups(data) {
  return request({
    url : prePath + '/assetDict/customizeGroups',
    method : 'post',
    data
  })
}

//获取设备档案分组
export function getEquipmentArchivesDetailCustomizeList(data) {
  return request({
    url : prePath + '/assetDict/customizeList/all',
    method : 'post',
    data
  })
}

//创建设备档案
export function createEquipmentArchives(data) {
  return request({
    url: prePath + '/assetDict',
    method: 'post',
    data
  })
}

//修改设备档案
export function updateEquipmentArchives(data) {
  return request({
    url: prePath + '/assetDict',
    method: 'put',
    data
  })
}

//删除设备档案
export function deleteEquipmentArchives(data) {
  return request({
    url : prePath + '/assetDict',
    method : 'delete',
    data
  })
}

//批量启用设备
export function enableEquipmentArchives(data) {
  return request({
    url: prePath + '/assetDict/enabled',
    method:'post',
    data
  })
}

//批量停用设备
export function disableEquipmentArchives(data) {
  return request({
    url: prePath + '/assetDict/disabled',
    method:'post',
    data
  })
}

//导出设备档案
export function exportEquipmentArchives(data) {
  return request({
    url: prePath + `/assetDict/excel`,
    method: "post",
    data,
    responseType: "blob"
  });
}

//设备档案批量打印产品码
export function printEquipmentArchivesCode(data) {
  return request({
    url: prePath + '/assetDict/print',
    method: 'post',
    data
  })
}

export function equipmentArchivesFile(data) {
  return request({
    url: prePath + '/assetDict/import/file',
    method: 'post',
    data
  })
}

export function equipmentArchivesVaildateFile(data) {
  return request({
    url: prePath + '/assetDict/import/vaildateFile',
    method: 'post',
    data
  })
}


/**配件档案**/


//获取配件档案的分页
export function getAccessoriesArchivesCustomizePage(data) {
  return request({
    url : prePath + '/accessoriesArchives/customizeList/page',
    method : 'post',
    data
  })
}

//根据{id}获取一条配件档案数据
export function detailAccessoriesArchives(id) {
  return request({
    url : prePath + '/accessoriesArchives/' + id,
    method : 'get'
  })
}

//获取配件档案分组
export function getAccessoriesArchivesDetailCustomizeGroups(data) {
  return request({
    url : prePath + '/accessoriesArchives/customizeGroups',
    method : 'post',
    data
  })
}

//获取配件档案分组
export function getAccessoriesArchivesDetailCustomizeList(data) {
  return request({
    url : prePath + '/accessoriesArchives/customizeList/all',
    method : 'post',
    data
  })
}

//创建配件档案
export function createAccessoriesArchives(data) {
  return request({
    url: prePath + '/accessoriesArchives',
    method: 'post',
    data
  })
}

//修改配件档案
export function updateAccessoriesArchives(data) {
  return request({
    url: prePath + '/accessoriesArchives',
    method: 'put',
    data
  })
}

//删除配件档案
export function deleteAccessoriesArchives(data) {
  return request({
    url : prePath + '/accessoriesArchives',
    method : 'delete',
    data
  })
}

//批量启用配件
export function enableAccessoriesArchives(data) {
  return request({
    url: prePath + '/accessoriesArchives/enabled',
    method:'post',
    data
  })
}

//批量停用配件
export function disableAccessoriesArchives(data) {
  return request({
    url: prePath + '/accessoriesArchives/disabled',
    method:'post',
    data
  })
}

//导出配件档案
export function exportAccessoriesArchives(data) {
  return request({
    url: prePath + `/accessoriesArchives/excel`,
    method: "post",
    data,
    responseType: "blob"
  });
}

//设备配件批量打印产品码
export function printAccessoriesArchivesCode(data) {
  return request({
    url: prePath + '/accessoriesArchives/print',
    method: 'post',
    data
  })
}

export function accessoriesArchivesFile(data) {
  return request({
    url: prePath + '/accessoriesArchives/import/file',
    method: 'post',
    data
  })
}

export function accessoriesArchivesVaildateFile(data) {
  return request({
    url: prePath + '/accessoriesArchives/import/vaildateFile',
    method: 'post',
    data
  })
}

/**计量器具**/

//获取计量器具的分页
export function getMeasuringInstrumentCustomizePage(data) {
  return request({
    url : prePath + '/measuringInstrument/customizeList/page',
    method : 'post',
    data
  })
}

//根据{id}获取一条计量器具数据
export function detailMeasuringInstrument(id) {
  return request({
    url : prePath + '/measuringInstrument/' + id,
    method : 'get'
  })
}

//获取计量器具分组
export function getMeasuringInstrumentDetailCustomizeGroups(data) {
  return request({
    url : prePath + '/measuringInstrument/customizeGroups',
    method : 'post',
    data
  })
}

//获取计量器具分组
export function getMeasuringInstrumentDetailCustomizeList(data) {
  return request({
    url : prePath + '/measuringInstrument/customizeList/all',
    method : 'post',
    data
  })
}

//创建计量器具
export function createMeasuringInstrument(data) {
  return request({
    url: prePath + '/measuringInstrument',
    method: 'post',
    data
  })
}
export function createMeasuringInstrumentAndSave(data) {
  return request({
    url: prePath + '/measuringInstrument/saveAndSubmit',
    method: 'post',
    data
  })
}

//修改计量器具
export function updateMeasuringInstrument(data) {
  return request({
    url: prePath + '/measuringInstrument',
    method: 'put',
    data
  })
}

//删除计量器具
export function deleteMeasuringInstrument(data) {
  return request({
    url : prePath + '/measuringInstrument',
    method : 'delete',
    data
  })
}
export function submitMeasuringInstrument(data) {
  return request({
    url: prePath + '/measuringInstrument/submit',
    method: 'post',
    data
  })
}
//批量启用计量器具
export function enableMeasuringInstrument(data) {
  return request({
    url: prePath + '/measuringInstrument/enabled',
    method:'post',
    data
  })
}

//批量停用计量器具
export function disableMeasuringInstrument(data) {
  return request({
    url: prePath + '/measuringInstrument/disabled',
    method:'post',
    data
  })
}

//导出计量器具
export function exportMeasuringInstrument(data) {
  return request({
    url: prePath + `/measuringInstrument/excel`,
    method: "post",
    data,
    responseType: "blob"
  });
}

//导出计量器具明细
export function exportMeasuringInstrumentDetail(id) {
  return request({
    url: prePath + `/measuringInstrument/detailExcel/`+id,
    method: "post",
    responseType: "blob"
  });
}

//设备计量器具打印产品码
export function printMeasuringInstrumentCode(data) {
  return request({
    url: prePath + '/measuringInstrument/print',
    method: 'post',
    data
  })
}

export function measuringInstrumentFile(data) {
  return request({
    url: prePath + '/measuringInstrument/import/file',
    method: 'post',
    data
  })
}

export function measuringInstrumentVaildateFile(data) {
  return request({
    url: prePath + '/measuringInstrument/import/vaildateFile',
    method: 'post',
    data
  })
}
/**计量器具完成**/
export function downloadFileAssetDict(data) {
  return request({
    url: prePath + '/assetDict/customizeList/download/file',
    method: 'post',
    responseType: 'blob',
    data
  })
}
export function downloadFileAccessoriesArchives(data) {
  return request({
    url: prePath + '/accessoriesArchives/customizeList/download/file',
    method: 'post',
    responseType: 'blob',
    data
  })
}
export function downloadFileMeasuringInstrument(data) {
  return request({
    url: prePath + '/measuringInstrument/customizeList/download/file',
    method: 'post',
    responseType: 'blob',
    data
  })
}
export function printMeasuringInstrument(data) {
  return request({
    url: prePath + '/measuringInstrument/printList',
    method: 'post',
    data
  })
}


